package com.itao.config.yml;

import com.itao.config.toml.TomlConfig;
import org.yaml.snakeyaml.Yaml;

import java.io.InputStream;
import java.util.Map;

/**
 * @Author sjt
 * @CreateTime 2024/6/6 15:12:58
 */
public class YmlConfig {

    private static final InputStream is;

    static {
        String path = "application.yml";
        is = TomlConfig.class.getClassLoader().getResourceAsStream(path);
    }

    public static void main(String[] args) {
        Yaml yaml = new Yaml();
        // 加载输入流
        Map<String, Object> configMap = yaml.load(is);
        // 打印或处理解析后的数据
        System.out.println(configMap);
    }
}
